package o;

import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

final class ayj {
    private static final ayj ˊ = new ayj();
    private SharedPreferences ˋ = ContentManager.getInstant().getContext().getSharedPreferences("model_protocl_data", 0);

    private ayj() {
    }

    public static ayj ˊ() {
        return ˊ;
    }

    public void ˋ(String str, String str2) {
        try {
            Editor edit = this.ˋ.edit();
            edit.putString(str, str2);
            edit.commit();
        } catch (Throwable e) {
            awg.ˎ.ˊ("SP", "putString error!!key:" + str, e);
        }
    }

    public void ˋ(String str, long j) {
        try {
            Editor edit = this.ˋ.edit();
            edit.putLong(str, j);
            edit.commit();
        } catch (Throwable e) {
            awg.ˎ.ˊ("SP", "putLong error!!key:" + str, e);
        }
    }

    public void ˎ(String str, boolean z) {
        try {
            Editor edit = this.ˋ.edit();
            edit.putBoolean(str, z);
            edit.commit();
        } catch (Throwable e) {
            awg.ˎ.ˊ("SP", "putBoolean error!!key:" + str, e);
        }
    }

    public String ˎ(String str, String str2) {
        try {
            str2 = this.ˋ.getString(str, str2);
        } catch (Throwable e) {
            awg.ˎ.ˊ("SP", "getString error!!key:" + str, e);
            this.ˋ.edit().remove(str).commit();
        }
        return str2;
    }

    public long ˎ(String str, long j) {
        try {
            j = this.ˋ.getLong(str, j);
        } catch (Throwable e) {
            awg.ˎ.ˊ("SP", "getLong error!!key:" + str, e);
            this.ˋ.edit().remove(str).commit();
        }
        return j;
    }

    public boolean ˏ(String str, boolean z) {
        try {
            z = this.ˋ.getBoolean(str, z);
        } catch (Throwable e) {
            awg.ˎ.ˊ("SP", "getBoolean error!!key:" + str, e);
            this.ˋ.edit().remove(str).commit();
        }
        return z;
    }

    public void ˏ(String str) {
        try {
            Editor edit = this.ˋ.edit();
            edit.remove(str);
            edit.commit();
        } catch (Throwable e) {
            awg.ˎ.ˊ("SP", "remove error key:" + str, e);
        }
    }
}
